package com.thn.netty.service;

import io.netty.channel.ChannelHandlerContext;

import com.thn.netty.chat.codec.IMPB;

public class LoginMessageHanlder implements IMessageHandler {


	public Boolean doWork(Object msgAgree, ChannelHandlerContext ctx,
			IMPB.Message group) {		
		try {
//			
//			//登录
//			InformationPacket.Login login = group.getLogin();			
//			//返回登录信息
//			ctx.writeAndFlush(msgAgree.doGetLoginInfoPacket(login.getUserName(), login.getUserPwd(), InformationPacket.Login.LoinEnum.Success, "OK"));
//			//组织好友列表信息
//			InformationPacket.Group.User.Builder userBean = InformationPacket.Group.User.newBuilder();
//			userBean.setId(ctx.channel().id().toString());
//			userBean.setUserName(login.getUserName());
//			userBean.setUserPwd("");
//			MsgHandleService.userList.put(ctx.channel().id().toString(), userBean.build());			
//			//群发送好友列表
//			MsgHandleService.channelGroup.writeAndFlush(msgAgree.doGetChatFriendsListInfoPacket(MsgHandleService.userList.values()));
			return true;
			
		} catch (Exception e) {
			// TODO: handle exception
			return false;
		}

		
	}

}
